module multiplier_8(a,b,HEX7,HEX6,HEX5,HEX4,HEX3,HEX2,HEX1,HEX0);
	input [8:1] a,b;
	output [0:6] HEX7,HEX6,HEX5,HEX4,HEX3,HEX2,HEX1,HEX0;
	wire[4:0] sum1,sum2,sum3,sum4;
	char_7seg u1(a[8:5],HEX7);
	char_7seg u2(a[4:1],HEX6);
	char_7seg u3(b[8:5],HEX5);
	char_7seg u4(b[4:1],HEX4);
	reg [15:0] out,ta;
	integer i;
	always @(a or b)
		begin
		out=16'b0;ta=a;
		for(i=1;i<=8;i=i+1)
		if(b[i]) out=out+(ta<<(i-1));
	end
	assign {sum1,sum2,sum3,sum4}=out;
	char_7seg u5(sum1,HEX3);
	char_7seg u6(sum2,HEX2);
	char_7seg u7(sum3,HEX1);
	char_7seg u8(sum4,HEX0);
endmodule 

module char_7seg(C,Y);
	input [3:0] C;
	output reg[0:6] Y;
	always @(*)
		begin
			case (C)
				4'b0:   Y=7'b0000001;
				4'b1:   Y=7'b1001111;
				4'b10:  Y=7'b0010010;
				4'b11:  Y=7'b0000110;
				4'b100: Y=7'b1001100;
				4'b101: Y=7'b0100100;
				4'b110: Y=7'b0100000;
				4'b111: Y=7'b0001111;
				4'b1000: Y=7'b0000000;
				4'b1001: Y=7'b0000100;
				4'b1010: Y=7'b0001000;
				4'b1011: Y=7'b1100000;
				4'b1100: Y=7'b1110010;
				4'b1101: Y=7'b1000010;
				4'b1110: Y=7'b0110000;
				4'b1111: Y=7'b0111000;
			endcase
		end
endmodule